package jmine.tec.rpc.server.representation.representers;

import jmine.tec.rpc.server.representation.RepresentationContext;

/**
 * {@link AbstractRepresenter} que transforma uma {@link Enum} em uma {@link String}
 * 
 * @author takeshi
 */
public class EnumAsStringRepresenter extends AbstractRepresenter<String, Enum> {

    /**
     * C'tor
     */
    public EnumAsStringRepresenter() {
        super(String.class, Enum.class);
    }

    /**
     * {@inheritDoc}
     */
    public String represent(RepresentationContext context, Enum object) {
        return object.name();
    }

}
